#ifndef PREDEF_H
#define PREDEF_H
#include <cstddef>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
namespace Master2Slave
{
    //enum ArmAttrType{kEndPos=0x01,kEndQuat=0x02,kEndVel=0x04,kGripperPos=0x08,kJointPos=0x10,kHeadPos=0x20,kVehicleVel=0x40,kWaistPos=0x80};
    enum ArmAttrType{kArmEndPos=0x01,kArmEndQuat=0x02,kArmEndLinearVel=0x04,kArmEndAngularVel=0x08,kArmEndWrench=0x10,
                     kHandJointPos=0x20,kHandJointForce=0x40};//kArmJointPos=0x40,kArmJointVel=0x80
    //enum ArmAttrType{kEndPos=0x01,kEndQuat=0x02,kEndLinearVel=0x04,kEndAngularVel=0x08,kEndForce=0x10,kJointPos=0x20,kJointVel=0x40,kJointForce=0x80};
    //enum HandAttrType{kGripperPos=0x01,kGripperVel=0x02,kGripperForce=0x04};
    enum HeadAttrType{kHeadPos=0x01,kHeadVel=0x02};
    enum WaistAttrType{kWaistPos=0x01,kWaistVel=0x02};
    enum VehicleAttrType{kVehicleVel=0x01};
}

namespace Slave2Master
{
    enum ArmAttrType{kArmEndPos=0x01,kArmEndQuat=0x02,kArmEndLinearVel=0x04,kArmEndAngularVel=0x08,kArmEndWrench=0x10,
                     kHandJointPos=0x20,kHandJointForce=0x40};//kArmJointPos=0x40,kArmJointVel=0x80
    //enum HandAttrType{kGripperPos=0x01,kGripperForce=0x02};
    enum HeadAttrType{kHeadPos=0x01,kHeadVel=0x02};
    enum WaistAttrType{kWaistPos=0x01,kWaistVel=0x02};
    enum VehicleAttrType{kVehicleVel=0x01};
}
//enum SlaveAttrType{kArmJointPos,kGripperPos,kEndForce,kWaistJointPos,kHeadPos,kVehicleVel}

//enum SlaveType{kArm=0x01,kHand,kWaist,kHead,kVehicle};
//enum PartType{kNoneIndex=0,kLeftArmIndex=1,kRightArmIndex,kLeftHandIndex,kRightHandIndex,kWaistIndex,kVehicleIndex};

//enum MasterType{kTouch=0,kOmiga7};
enum MasterIndex{kNoneDeviceIndex=-1,kLeftDeviceIndex=0,kRightDeviceIndex=1};
enum SlaveIndex{kNoneIndex=0,kLeftArmHandIndex=1,kRightArmHandIndex,kVehicleIndex,kWaistIndex};//,kLeftHandIndex,kRightHandIndex
extern const char *master_names[2];//={"left_device ","right_device"};
extern const char *slave_names[5];//={"no_target","left_handarm","right_handarm","vehicle","waist"};

enum ErrorCode{kNoDeviceAllocated=-101,kNoDeviceConnection=-100,kOkay=0,kNoControlTarget,kNoSocketConnection};

//#define USING_FLOAT_DATA float;
typedef float SocketDataType;
const size_t kSocketBufferLen=256;

enum SunlinkProtocal {kSunlinkHeader1=0x42,kSunlinkHeader2=0x53,kSunlinkVersion=0x03};
enum MsgId{Monitor2RC_Start=3200,Monitor2RC_Stop=3201,Monitor2RC_Pause=3202,Monitor2RC_Resume=3203,Monitor2RC_Switch=3204,Monitor2RC_Robotlost=3205,
           Robot2RC_Feedback_Vehicle=3206,Robot2RC_Feedback_Head=3207,Robot2RC_Feedback_ArmHand=3208,
           RC2Monitor_Feedback=3250,RC2Robot_Control=3251,RC2Robot_Command=3253};
enum SocketTerminal{RemoteControl=0x01,Robot=0x02};

namespace main_controller
{
    enum RunningStatusType{kRCStop=0,kRCWorking,kRCPause};
    enum SocketConnectionStatusType{kConnectionOkay=0,kConnection2RobotLost,kConnection2MonitorLost};
}

extern bool global_stop_flag;




#endif // PREDEF_H
